# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Christian Pfeiffer <cpfeiffer at live dot de>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: jwwolf <jwwolf+arch@gmail.com>
# Contributor: Bernhard Walle <bernhard@bwalle.de>

pkgname=crosstool-ng
pkgver=1.26.0
pkgrel=1
pkgdesc='A versatile (cross-)toolchain generator'
arch=(loong64 x86_64)
url=https://crosstool-ng.github.io/
license=(GPL2)
depends=(
  git
  gperf
  help2man
  lzip
  meson
  ncurses
  python
  rsync
  unzip
)
_tag=334f6d6479096b20e80fd39e35f404319bc251b5
source=(git+https://github.com/crosstool-ng/crosstool-ng.git#tag=${_tag})
b2sums=(SKIP)

prepare() {
  cd crosstool-ng
  ./bootstrap
}

pkgver() {
  cd crosstool-ng
  git describe --tags | sed 's/^crosstool-ng-//'
}

build() {
  cd crosstool-ng
  ./configure \
    --prefix=/usr \
    --libexecdir=/usr/lib \
    --with-bash-completion \
    --with-ncurses
  make
}

package() {
  cd crosstool-ng
  make DESTDIR="${pkgdir}" install
}

# vim: ts=2 sw=2 et:
